import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export const constantRouterMap = [
  {
    path: "/",
    component: () => import("@/views/login/index"),
    hidden: true
  },
  {
    path: "/login",
    component: () => import("@/views/login/index"),
    hidden: true
  },
  {
    path: "/index",
    component: () => import("@/layout"),
    meta: { title: "自述文件" },
    children: [
      {
        path: "/index/index",
        meta: { title: "首页" },
        component: () => import("@/views/index/index")
      }
    ]
  },
  {
    path: "/base-data",
    component: () => import("@/layout"),
    meta: { title: "档案管理" },
    children: [
      {
        path: "/base-data/seven-districts",
        meta: { title: "七大区" },
        component: () => import("@/views/base-data/seven-districts")
      },
      {
        path: "/base-data/itoc",
        meta: { title: "运营中心" },
        component: () => import("@/views/base-data/itoc")
      },
      {
        path: "/base-data/merchant",
        meta: { title: "商家档案" },
        component: () => import("@/views/base-data/merchant")
      },
      {
        path: "/base-data/product-archive",
        component: () => import("@/views/base-data/product-archive"),
        meta: { title: "商品档案" }
      },
      {
        path: "/base-data/supplier-profile",
        meta: { title: "供应商档案" },
        component: () => import("@/views/base-data/supplier-profile")
      },
      {
        path: "/base-data/supplier-details",
        meta: { title: "供应商详情" },
        component: () => import("@/views/base-data/supplier-details"),
        hidden: true
      },
      {
        path: "/base-data/investor-profile",
        meta: { title: "投资人档案" },
        component: () => import("@/views/base-data/investor-profile")
      },
      {
        path: "/base-data/partner-profile",
        meta: { title: "合伙人档案" },
        component: () => import("@/views/base-data/partner-profile")
      },
      {
        path: "/base-data/itoc-staff",
        meta: { title: "运营中心人员档案" },
        component: () => import("@/views/base-data/itoc-staff")
      },
      {
        path: "/base-data/mainten-profile",
        meta: { title: "维护人档案" },
        component: () => import("@/views/base-data/mainten-profile")
      },
      {
        path: "/base-data/shipper-profile",
        meta: { title: "配送公司档案" },
        component: () => import("@/views/base-data/shipper-profile")
      },
      {
        path: "/base-data/shipper-details",
        meta: { title: "配送公司详情" },
        component: () => import("@/views/base-data/shipper-details"),
        hidden: true
      },
      {
        path: "/base-data/regional-archive",
        meta: { title: "区域档案" },
        component: () => import("@/views/base-data/regional-archive")
      }
    ]
  },
  {
    path: "/terminal-data",
    component: () => import("@/layout"),
    meta: { title: "终端管理" },
    children: [
      {
        path: "/terminal-data/terminal-list",
        meta: { title: "终端列表" },
        component: () => import("@/views/terminal-data/terminal-list")
      },
      {
        path: "/terminal-data/cargo-lane-manag",
        meta: { title: "货道管理" },
        component: () => import("@/views/terminal-data/cargo-lane-manag"),
        hidden: true
      },
      {
        path: "/terminal-data/terminal-application",
        meta: { title: "终端申请" },
        component: () => import("@/views/terminal-data/terminal-application")
      },
      {
        path: "/terminal-data/terminal-purchase-order",
        meta: { title: "总部采购单（终端）" },
        component: () =>
          import("@/views/terminal-data/terminal-purchase-order"),
        hidden: true
      },
      {
        path: "/terminal-data/purchase-order-management",
        meta: { title: "采购单管理" },
        component: () =>
          import("@/views/terminal-data/purchase-order-management")
      },
      {
        path: "/terminal-data/purchase-order-details",
        meta: { title: "采购单详情" },
        component: () => import("@/views/terminal-data/purchase-order-details"),
        hidden: true
      },
      {
        path: "/terminal-data/terminal-log",
        meta: { title: "终端日志列表" },
        component: () => import("@/views/terminal-data/terminal-log")
      },
      {
        path: "/terminal-data/fault-manage",
        meta: { title: "终端故障列表" },
        component: () => import("@/views/terminal-data/fault-manage")
      }
    ]
  },
  {
    path: "/orders",
    component: () => import("@/layout"),
    meta: { title: "订单管理" },
    children: [
      {
        path: "/orders/orders-list",
        meta: { title: "订单列表" },
        component: () => import("@/views/orders/orders-list")
      }
    ]
  },
  {
    path: "/book",
    component: () => import("@/layout"),
    meta: { title: "预定管理" },
    children: [
      {
        path: "/orders/book-list",
        meta: { title: "预定列表" },
        component: () => import("@/views/orders/book-list")
      },
      {
        path: "/orders/order-form",
        meta: { title: "采购申请单" },
        component: () => import("@/views/orders/order-form"),
        hidden: true
      }
    ]
  },
  // {
  //   path: "/inventory-data",
  //   component: () => import("@/layout"),
  //   meta: { title: "库存管理" },
  //   children: [
  //     {
  //       path: "/inventory-data/out-of-stock-list",
  //       meta: { title: "仓库缺货列表" },
  //       component: () => import("@/views/inventory-data/out-of-stock-list")
  //     },
  //     {
  //       path: "/inventory-data/pickup-manage",
  //       meta: { title: "提货管理" },
  //       component: () => import("@/views/inventory-data/pickup-manage")
  //     },
  //     {
  //       path: "/inventory-data/warehouse-manage",
  //       meta: { title: "入库管理" },
  //       component: () => import("@/views/inventory-data/warehouse-manage")
  //     }
  // {
  //   path: "/base-data/basic-information/index",
  //   component: () => import("@/views/base-data/basic-information/index"),
  //   meta: { title: "库存报表" },
  //   children: [
  //     {
  //       path: "/inventory-data/inventory-report",
  //       meta: { title: "仓库库存报表" },
  //       component: () => import("@/views/inventory-data/inventory-report")
  //     },
  //     {
  //       path: "/inventory-data/statistical-table",
  //       meta: { title: "出入库统计表" },
  //       component: () => import("@/views/inventory-data/statistical-table")
  //     },
  //     {
  //       path: "/inventory-data/detail-table",
  //       meta: { title: "出入库明细表" },
  //       component: () => import("@/views/inventory-data/detail-table")
  //     }
  //   ]
  // }
  //   ]
  // },
  {
    path: "/purchase-data",
    component: () => import("@/layout"),
    meta: { title: "采购管理" },
    children: [
      {
        path: "/purchase-data/purchase-requisition-list",
        meta: { title: "运营中心采购申请单列表" },
        component: () =>
          import("@/views/purchase-data/purchase-requisition-list")
      },
      {
        path: "/purchase-data/create-purchase-requisition",
        meta: { title: "新建采购申请单" },
        component: () =>
          import("@/views/purchase-data/create-purchase-requisition"),
        hidden: true
      }
    ]
  },
  {
    path: "/replenishment-data",
    component: () => import("@/layout"),
    meta: { title: "补货管理" },
    children: [
      {
        path: "/replenishment-data/replenishment-list",
        meta: { title: "补货列表" },
        component: () => import("@/views/replenishment-data/replenishment-list")
      },
      {
        path: "/replenishment-data/recycle-list",
        meta: { title: "回收列表" },
        component: () => import("@/views/replenishment-data/recycle-list")
      }
    ]
  },
  {
    path: "/meal-manage",
    component: () => import("@/layout"),
    meta: { title: "餐品管理" },
    children: [
      {
        path: "/meal-manage/meals-list",
        meta: { title: "排餐列表" },
        component: () => import("@/views/meal-manage/meals-list")
      },
      {
        path: "/meal-manage/meals-list-detail",
        meta: { title: "餐品详情" },
        component: () => import("@/views/meal-manage/meals-list-detail"),
        hidden: true
      }
    ]
  },
  {
    path: "/price-data",
    component: () => import("@/layout"),
    meta: { title: "价格管理" },
    children: [
      {
        path: "/price-data/adjust-price-application-list",
        meta: { title: "调价申请列表" },
        component: () =>
          import("@/views/price-data/adjust-price-application-list")
      },
      {
        path: "/price-data/adjust-price-application",
        meta: { title: "调价申请" },
        component: () => import("@/views/price-data/adjust-price-application"),
        hidden: true
      },
      {
        path: "/price-data/price-exception-report",
        meta: { title: "价格异常报表" },
        component: () => import("@/views/price-data/price-exception-report")
      }
    ]
  },
  {
    path: "/data-report",
    component: () => import("@/layout"),
    meta: { title: "数据报表" },
    children: [
      {
        path: "/data-report/sales-volume",
        meta: { title: "终端销售量统计" },
        component: () => import("@/views/data-report/sales-volume")
      },
      {
        path: "/data-report/sales-statistics",
        meta: { title: "终端销售额统计" },
        component: () => import("@/views/data-report/sales-statistics")
      },
      {
        path: "/data-report/goods-sales-volume",
        meta: { title: "商品销售量统计" },
        component: () => import("@/views/data-report/goods-sales-volume")
      },
      {
        path: "/data-report/goods-sales-statistics",
        meta: { title: "商品销售额统计" },
        component: () => import("@/views/data-report/goods-sales-statistics")
      },
      {
        path: "/data-report/payment-method",
        meta: { title: "支付方式统计" },
        component: () => import("@/views/data-report/payment-method")
      },
      {
        path: "/data-report/good-purchase",
        meta: { title: "商品采购统计" },
        component: () => import("@/views/data-report/good-purchase")
      },
      {
        path: "/data-report/replenish-purchase",
        meta: { title: "终端补货统计" },
        component: () => import("@/views/data-report/replenish-purchase")
      },
      {
        path: "/data-report/amount-purchase",
        meta: { title: "终端数量统计" },
        component: () => import("@/views/data-report/amount-purchase")
      }
    ]
  },
  {
    path: "/help-center",
    component: () => import("@/layout"),
    meta: { title: "帮助中心" },
    children: [
      {
        path: "/help-center/personal-set",
        meta: { title: "个人设置" },
        component: () => import("@/views/help-center/personal-set")
      }
    ]
  },
  {
    path: "/menu",
    component: () => import("@/layout"),
    meta: { title: "菜单管理" },
    children: [
      {
        path: "/menu/menu-list",
        meta: { title: "菜单列表" },
        component: () => import("@/views/menu/menu-list")
      }
    ]
  },
  {
    path: "/operat-manage",
    component: () => import("@/layout"),
    meta: { title: "运营管理" },
    children: [
      {
        path: "/operat-manage/member-list",
        meta: { title: "会员列表" },
        component: () => import("@/views/operat-manage/member-list")
      }
    ]
  },
  {
    path: "/assess-manage",
    component: () => import("@/layout"),
    meta: { title: "评价管理" },
    children: [
      {
        path: "/assess-manage/assess-list",
        meta: { title: "评价管理" },
        component: () => import("@/views/assess-manage/assess-list")
      },
      {
        path: "/assess-manage/assess-detail",
        meta: { title: "评价详情" },
        component: () => import("@/views/assess-manage/assess-detail"),
        hidden: true
      }
    ]
  },
  {
    path: "/404",
    component: () => import("@/views/errorPage/404"),
    hidden: true
  },
  {
    path: "/401",
    component: () => import("@/views/errorPage/401"),
    hidden: true
  }
];

export default new Router({
  // mode: "history",
  fallback: true,
  linkActiveClass: "active-link",
  linkExactActiveClass: "exact-active-link",
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRouterMap
});
